Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 6 - Printing Resources / Printing Resources Reference
Resources Used Only in Printer Drivers


The Raster Preferences ('rdip') Resource

The raster preferences ('rdip') resource, of type gxRasterPrefsType, controls the rendering options for a raster driver. This resource is required for all raster printer drivers. Figure 6-23 shows the structure of a raster preferences resource.

Figure 6-23 The raster preferences resource

The raster preferences resource contains a number of values that define how imaging is performed on the device, followed by an array of plane values, each of which defines parameters for a specific color on the printer. For example, if your driver accepts CMYK (cyan, magenta, yellow, and black color specification) data, QuickDraw GX sends it planes for cyan, magenta, yellow, and black. The values in the plane array correspond to the number of times that you need to send raster data to the printer for color printing.

You need to understand how QuickDraw GX represents and uses colors to understand many of the values in this resource. Refer to two chapters in Inside Macintosh: QuickDraw GX Objects: the "View Objects" chapter and the "Colors and Color-Related Objects" chapter.

Each entry in the plane array is for a specific color. For example, a driver that accepts CMYK data is sent planes for cyan, magenta, yellow, and black. This data may or may not be equivalent to a band on a ribbon, an ink color, or a wax color; however, each plane that you define in this array does represent one pass of data by the device. Each entry in the plane array contains the following data values.

Table 6-28 shows the constants that you can use to specify the option values for the raster preferences resource.
Table 6-28 Raster preference option values
ConstantValueExplanation
gxDefaultRaster0Uses default options
gxDontResolveTransferModes0x01Tells the system to not resolve transfer modes because your 32-bit device can do it faster on its own
gxRenderInReverse0x02Traverses the image in reverse order
gxOnePlaneAtATime0x04Renders each plane separately
gxSendAllBands0x08Sends bands, even if empty (all white)

Table 6-29 shows the constants that you can use to specify the plane flags values for the raster preferences resource.
Table 6-29 Flags used for each plane in the raster preferences resource
ConstantValueExplanation
gxDefaultOffscreen0Specifies that the default settings are used, which means that the view port's halftone is based on the information in the imaging system data.
gxDontSetHalftone1Specifies that the system must not set the view port's halftone. Use this option when you do not want halftones on a device.
gxDotTypeIsDitherLevel2Specifies that the system must set the view port's dither level to the value stored in the gxDotType parameter and ignore other halftone information.

Table 6-30 shows the constants that you can use to specify the plane dithering types for the raster preferences resource.
Table 6-30 Plane dithering types
ConstantValue
gxRoundDot1
gxSpiralDot2
gxSquareDot3
gxLineDot4
gxEllipticDot5
gxTriangleDot6
gxDispersedDot7

Table 6-31 shows the constants that you can use to specify the plane tinting types for the raster preferences resource.
Table 6-31 Plane tinting types
ConstantValueExplanation
gxLuminanceTint1Use the luminance of the color
gxAverageTint2Add all the components, then divide by the number of components
gxMixtureTint3Find the closest color on the axis between the foreground and background colors
gxComponent1Tint4Use the value of the first component of
the color space
gxComponent2Tint5Use the value of the second component of the color space
gxComponent3Tint6Use the value of the third component of the color space
gxComponent4Tint7Use the value of the fourth component of the color space

The ID of the raster preferences resource must be the constant gxRasterPrefsID. Listing 6-21 shows an example of a raster preferences resource for a 144-dpi four-plane color device, the ImageWriter II raster printer.

Listing 6-21 An example of a raster preferences resource

resource gxRasterPrefsType (gxRasterPrefsID, sysHeap, purgeable)
{
   gxDefaultRaster,        /* default options are fine */
   
   0x00900000,0x00900000,  /* 144X144 dpi device */
   16,                     /* min band size is 2 head heights */
   0,                      /* max band size (0 is full page) */
   0x00004000,             /* RAM percentage (25%) */
   100*1024,               /* RAM slop (100K) */
   4,                      /* 4 bit per plane device */
      {
      /* dithering offscreen */
      3,          /* gxDontSetHalftone+gxDotTypeIsDitherLevel */
      
      0x002D0000,          /* angle unused for dithering */
      0x003C0000,          /* freq unused for dithering */
      4,                   /* dithering with a level of 4 */
      gxLuminanceTint,     /* tint space unused for dithering */
      
                        /* dot color is unused for dithering */
      gxRGBSpace, gxNoProfile, 0, 0, 0, 0, 
                        /* background is unused for dithering */
      gxRGBSpace, gxNoProfile, 0xFFFF, 0xFFFF, 0xFFFF, 0,

      gxRGBSpace,       /* halftone space unused for dithering */

      gxIndexedSpace,         /* indexed color space */
      gxPrintingDriverBaseID, /* ID of the color set to use */
      gxPrintingDriverBaseID, /* ID of the color profile to use */
      };
}; 

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help